<template>
	<view class="pages-technician" :style="{background:pageColor}">
		<fixed @height="initFixHeight" :initHeight="fixHeight" page="pages/technician">
			<block v-if="configInfo.coach_format !== 3">
				<uni-nav-bar :fixed="false" :shadow="false" :statusBar="true" :onlyLeft="true" :color="`#000`"
					:backgroundColor="'#fff'">
					<view class="flex-between" style="width:100%" slot="left">
						<view @tap.stop="$util.goUrl({url:`/user/pages/choose/index`})"
							class="map-info flex-y-center c-base"
							:style="{width:configInfo.plugAuth.map?'calc(100% - 184rpx)':'100%'}" style="color: #000;">
              <img src="../static/img/technician/Group.png" alt="" srcset="" style="width: 36rpx;height: 36rpx;">
							<view class="map-text ellipsis" style="max-width:65%;font-size: 30rpx;color: rgba(0,0,0,0.8);margin-left: 14rpx">
								<block v-if="configInfo.user_update_location"> {{location | handleAddrText}}
								</block>
								<block v-else>{{city_info | handleCityText}} </block>
							</view>
              <view class="arrow">
                <i class="iconfont icon-right text-bold" style="font-size: 22rpx"></i>
              </view>
						</view>

						<view class="" v-if="configInfo.plugAuth.map" style="display: flex;align-items: center;">
							<view  v-if="!isSearch" @tap.stop="handleSearch" style="display: flex;align-items: center;margin-right: 24rpx">
						  <img src="../static/img/technician/search.png" alt="" style="width: 48rpx;height: 48rpx;">
					  </view>
					<view v-else class="" style="margin-right: 20rpx;">
						<search @input="toSearch" type="input" :keyword="param.coach_name" :padding="0"
							:radius="30" height="40rpx" backgroundColor="#F0F0F0"
							:placeholder="'请输入'">
						</search>
					</view>
					<view style="height:  80rpx;display: flex;align-items: center;justify-content: center;">
					<view class="flex-y-center" style="background: #E5E5E5;border-radius: 8rpx;padding: 4rpx">
							<view class="list-btn flex-center f-icontext rel"
								:style="{color:'#56625D',borderColor:'#fff', background:'#fff'}" style="width: 62rpx;height: 40rpx;">
								<view class="list-btn abs" :style="{background:'#fff'}" >
								</view>
								<!-- <i class="iconfont iconliebiaomoshi2"></i> -->
								列表
							</view>
							<view @tap.stop="$util.goUrl({url:`/pages/map`})"
								class="list-btn flex-center f-icontext rel" style="width: 62rpx;height: 40rpx;border-left: none;">
								<!-- <i class="iconfont icondituzhaoren2"></i> -->
								地图
							</view>
						</view></view>
						</view>
					</view>
				</uni-nav-bar>
			</block>
			<block v-else>
				<!-- #ifndef H5 -->
				<uni-nav-bar :fixed="false" :shadow="false" :statusBar="true" :title="navTitle" color="#ffffff"
					:backgroundColor="primaryColor">
				</uni-nav-bar>
				<!-- #endif -->
			</block>
			<!-- height: list.merchant_phone ? configInfo.coach_format == 2 && configInfo.coach_career_show == 1 ? configInfo.coach_filter_show ? '416rpx' : '330rpx' : configInfo.coach_filter_show ? configInfo.coach_format == 2 ? '306rpx' : configInfo.coach_format == 3 ? '396rpx' : '406rpx' : configInfo.coach_format == 2 ? '220rpx' : configInfo.coach_format == 3 ? '396rpx' : '320rpx':
			configInfo.coach_format == 2 && configInfo.coach_career_show == 1 ? configInfo.coach_filter_show ? '344rpx' : '258rpx' : configInfo.coach_filter_show ? configInfo.coach_format == 2 ? '234rpx' : configInfo.coach_format == 3 ? '324rpx' : '334rpx' : configInfo.coach_format == 2 ? '148rpx' : configInfo.coach_format == 3 ? '324rpx' : '248rpx' -->
			<view :style="{background:pageColor}">
				<view class="fix-info rel" :class="[{'fill-base':!param.city_id && list.no_city}]"
					:style="{height:configInfo.coach_format == 2 && configInfo.coach_career_show == 1 ? configInfo.coach_filter_show ? '344rpx' : '258rpx' : configInfo.coach_filter_show ? configInfo.coach_format == 2 ? '234rpx' : configInfo.coach_format == 3 ? '324rpx' : '160rpx' : configInfo.coach_format == 2 ? '148rpx' : configInfo.coach_format == 3 ? '324rpx' : '248rpx'}">
<!--					<view class="space-top abs" :style="{background:primaryColor}" v-if="configInfo.coach_format!=3">
					</view>-->
					
					<view class="abs" style="width:100%;top:0">
						<view class="pt-sm pl-lg pr-lg"
							:class="[{'pb-sm':configInfo.coach_format==1 },{'pb-sm':configInfo.coach_format==3}]"
							:style="{borderRadius:configInfo.coach_format==3?'0rpx':''}">
							<view class="flex-between pb-lg" v-if="configInfo.coach_format==3">
								<view @tap.stop="$util.goUrl({url:`/user/pages/choose/index`})"
									class="map-info flex-y-center">
									<view class="flex-y-center">
										<i class="iconfont iconjuli mr-sm" :style="{color:primaryColor}"></i>
										<view class="map-text ellipsis"
											:style="{maxWidth:configInfo.plugAuth.map?'400rpx':'600rpx'}">
											<block v-if="configInfo.user_update_location"> {{location | handleAddrText}}
											</block>
											<block v-else>{{city_info | handleCityText}}</block>
										</view>
										<i class="iconfont icon-down"></i>
									</view>
								</view>
								<view class="map-list-item flex-y-center" v-if="configInfo.plugAuth.map" style="border: 1rpx solid #e5e5e5;border-radius: 8rpx;">
									<view class="list-btn flex-center f-icontext rel"
										:style="{color:'#56625D',borderColor:'#fff'}">
										<view class="list-btn abs" :style="{background:primaryColor}">
										</view>
										<!-- <i class="iconfont iconliebiaomoshi2"></i> -->
										列表
									</view>
									<view @tap.stop="$util.goUrl({url:`/pages/map`})"
										class="list-btn flex-center f-icontext rel" style="border-left: none;">
										<!-- <i class="iconfont icondituzhaoren2"></i> -->
										地图
									</view>
								</view>
							</view>
							<!--<view class="flex-1"
								:class="[{'pb-sm':configInfo.coach_format !=2},{'pb-lg':configInfo.coach_format == 2}]">
								<search @input="toSearch" type="input" :keyword="param.coach_name" :padding="0"
									:radius="30" height="70rpx" backgroundColor="#F0F0F0"
									:placeholder="'请输入'+$t('action.attendantName')+'姓名'">
								</search>
							</view>-->
<!--							<block v-if="configInfo.coach_format == 1">
								<tab @change="handerTabChange($event, 'activeIndex')" :list="tabList"
									:activeIndex="activeIndex*1" :activeColor="primaryColor" width="25%" height="90rpx"
									fontSize="28rpx"></tab>
							</block>-->
							<view v-if="configInfo.coach_format == 2 && configInfo.coach_career_show == 1"
								style="height: 110rpx;">
								<tab @change="handerTabChange($event, 'careerIndex')" :list="careerList"
									:activeIndex="careerIndex*1" :activeColor="primaryColor" width="25%" height="66rpx"
									lineClass="mini" fontSize="28rpx"></tab>
							</view>
							<view class="cate-filter-list flex-warp" v-if="configInfo.coach_format == 3">
								<view @tap.stop="toChangeItem('type', 0,2)" class="filter-item flex-center rel">
									<image class="cate-img abs"
										:class="[{ grayscale: param.type || check.recommend || check.free_fare }]"
										:src="`${base_img_url}/menu2/all.png`"></image>
									<view class="cate-text flex-center f-desc text-bold rel"
										:style="{color:!param.type && !check.recommend && !check.free_fare ?'#44A860':''}">
										全部
									</view>
								</view>
								<view @tap.stop="toChangeItem('type', 1,2)" class="filter-item flex-center rel">
									<image class="cate-img abs" :class="[{ grayscale: !param.type  }]"
										:src="`${base_img_url}/menu2/fuwu.png`"></image>
									<view class="cate-text flex-center f-desc text-bold rel"
										:style="{color:param.type===1?'#44A860':''}">
										{{configInfo.btn_config[0].text}}
									</view>
								</view>
								<view @tap.stop="toChangeItem('recommend', 1,2)" class="filter-item flex-center rel"
									v-if="configInfo.plugAuth.recommend">
									<image class="cate-img abs" :class="[{ grayscale: !check.recommend  }]"
										:src="`${base_img_url}/menu2/recommend.png`"></image>
									<view class="cate-text flex-center f-desc text-bold rel"
										:style="{color:check.recommend?'#44A860':''}">
										{{recommend_text}}
									</view>
								</view>
								<view @tap.stop="toChangeItem('free_fare', 1 ,2)" class="filter-item flex-center rel"
									v-if="configInfo.free_fare_select">
									<image class="cate-img abs" :class="[{ grayscale: !check.free_fare  }]"
										:src="`${base_img_url}/menu2/car-fee.png`"></image>
									<view class="cate-text flex-center f-desc text-bold rel"
										:style="{color:check.free_fare?'#44A860':''}">
										免出行
									</view>
								</view>
							</view>
						</view>

            <view class="search-cate-list flex-warp mt-sm mr-md pb-sm"
                  v-if="configInfo.coach_filter_show == 1">
              <view @tap.stop="toChangeItem('recommend', check.recommend == 0 ? 1 : 0,1)"
                    :class="['search-cate-list-tab', 'flex-center', 'f-desc', 'radius-16', 'mr-lg', check.recommend ? 'activeTab' : '']"
                    v-if="configInfo.plugAuth.recommend">
                <view class="ellipsis">
                  {{recommend_text}}
<!--                  {{$t('action.attendantName')}}-->
                </view>
                <view class="line" v-if="check.recommend"></view>
              </view>
              <view @tap.stop="toChangeItem('free_fare', check.free_fare == 0 ? 1 : 0,1)"
                    :class="['search-cate-list-tab', 'flex-center', 'f-desc', 'radius-16', 'mr-lg', check.free_fare ? 'activeTab' : '']"
                    v-if="configInfo.free_fare_select">
                <view class="ellipsis">免出行费</view>
                <view class="line" v-if="check.free_fare"></view>
              </view>
              <view @tap.stop="toChangeItem('cate_id',item.id,1)"
                    :class="['search-cate-list-tab', 'flex-center', 'f-desc', 'radius-16', 'mr-lg', check.cate_id ? 'activeTab' : '']"
                    v-for="(item,index) in serviceCateList" :key="index"
                    v-show="((configInfo.free_fare_select && configInfo.plugAuth.recommend && index < 1) || ((!configInfo.free_fare_select || !configInfo.plugAuth.recommend) && index < 2) || (!configInfo.free_fare_select && !configInfo.plugAuth.recommend && index < 3))">
                <view class="ellipsis">{{item.title}}</view>
                <view class="line" v-if="check.cate_id"></view>
              </view>
              <!--							<view @tap.stop="toPopup('search_item','open')"
                              class="item-child flex-center f-desc radius-16">
                              更多筛选</view>-->
            </view>
            <view class="technicianTab">
              <DropdownMenu  ref="myDropdown">
                <DropdownItem
                    v-model="intelligentSortValue"
                    :options="sortList"
                    title="智能排序"
                    @change="intelligentSortChange"
                />
                <DropdownItem
                    v-model="send_info.time_str"
                    title="服务时段"
                    :isCustom="true"
                    @onTitleClick="onTitleClick"
                >
                  <template #content>
                    <view class="popup-time fill-base">
                      <tab @change="handerTimeTabChange" :list="tabTimeList" :activeIndex="timeActiveIndex*1" :activeColor="primaryColor"
                           height="80rpx" class="service-dropdown" textFontSize="24rpx" activeTextFontSize="24rpx"></tab>
                      <scroll-view scroll-y @touchmove.stop.prevent class="time-list">
                          <view @tap.stop="toChooseTime(index)" class="time-item flex-center flex-column"
                                :class="[{'can-choose':item.status && send_info.time_str != item.time_str},{'cur-check':send_info.time_str == item.time_str}]"
                                :style="{background:send_info.time_str == item.time_str ?primaryColor:''}"
                                v-for="(item,index) in timeList" :key="index"
                                v-if="item.status">
                            <view class="f-title">{{item.time_text}}</view>
                          </view>
                          <view class="ml-md c-caption" v-if="timeList.length==0">暂无时间段</view>
                      </scroll-view>
                      <view class="btn-list pd-lg flex-center f-mini-title">
                        <view class="item-btn flex-center f-desc c-base radius mr-lg"
                              :style="{background: '#888'}" @tap.stop="restBtn">
                          重置
                        </view>
                        <view class="item-btn flex-center f-desc c-base radius"
                              :style="{background: primaryColor}" @tap.stop="sureBtn">
                          确定
                        </view>
                      </view>
                    </view>
                  </template>
                </DropdownItem>
                <DropdownItem
                    v-model="allSortData"
                    :isCustom="true"
                    title="全部筛选"
                >
                  <template #content>
                    <view class="all-filter fill-base">
                      <view class="all-filter-cont">
                        <block v-if="isCareer">
                          <view class="flex-warp">
                            <view @tap.stop="toChangeCareer(index)"
                                  class="list-item pt-sm pb-sm pr-sm pl-sm flex-center mt-md mr-md f-paragraph c-paragraph radius pl-sm pr-sm"
                                  :style="{background:checkCareerIndex==index?primaryColor:'',color:checkCareerIndex==index?'#fff':''}"
                                  v-for="(item,index) in careerList" :key="index">{{item.title}}
                            </view>
                          </view>
                        </block>
                        <block v-else>
                          <block v-if="configInfo.coach_filter_show !== 2">
                            <view class="c-title pt-lg" style="padding-top: 8rpx;padding-bottom: 8rpx;font-size: 22rpx;">{{$t('action.attendantName')}}性别
                            </view>
                            <view class="flex-warp">
                              <view @tap.stop="toChangeItem('sex',item.id, 0)"
                                    class="list-item flex-center mr-md f-paragraph c-paragraph radius"
                                    :style="{background:check.sex==item.id?primaryColor:'',color:check.sex==item.id?'#fff':''}"
                                    v-for="(item,index) in sexList" :key="index">{{item.title}}
                              </view>
                            </view>
                          </block>
                          <block>
                            <view class="c-title pt-lg" style="padding-top: 8rpx;padding-bottom: 8rpx;font-size: 22rpx;">服务筛选
                            </view>
                            <view class="flex-warp">
                              <view @tap.stop="toChangeItem('serviceFilter',item.id, 0)"
                                    class="list-item flex-center mr-md f-paragraph c-paragraph radius"
                                    :style="{background:check.serviceFilter==item.id?primaryColor:'',color:check.serviceFilter==item.id?'#fff':''}"
                                    v-for="(item,index) in serviceFilterList" :key="index">{{item.title}}
                              </view>
                            </view>
                          </block>
                          <block v-if="serviceCateList && serviceCateList.length>0">
                            <view class="c-title pt-lg" style="padding-top: 8rpx;padding-bottom: 8rpx;font-size: 22rpx;">
                              服务分类
                            </view>
                            <view class="service-cate-scroll">
                              <scroll-view scroll-y>
                                <view class="flex-warp">
                                  <view @tap.stop="toChangeItem('cate_id',item.id)"
                                        class="list-item flex-center mt-md mr-md f-paragraph c-paragraph radius"
                                        :style="{background:check.cate_id==item.id?primaryColor:'',color:check.cate_id==item.id?'#fff':''}"
                                        v-for="(item,index) in serviceCateList" :key="index">{{item.title}}
                                  </view>
                                </view>
                              </scroll-view>
                            </view>
                          </block>

                          <block>
                            <view class="c-title pt-lg flex-between" style="padding-top: 8rpx;padding-bottom: 8rpx;font-size: 22rpx;">
                              <view class="flex-y-center">
                                <view>
                                  技师距离
                                </view>
                                <view class="c-caption f-caption ml-md">(km)</view>
                              </view>
                              <view class="c-caption">
                                {{ check.distance === 10 ? '全城' : check.distance + ' km' }}
                              </view>
                            </view>
                              <my-slider
                                  class=""
								  style="margin-top: 8rpx;"
                                  v-model="check.distance"
                                  :min="0"
                                  :max="10"
                                  :step="1"
                                  :activeColor="primaryColor"
                                  :centerCircleColor="primaryColor"
                              >
                                <template v-slot:button>
                                  {{ check.distance === 10 ? '全城' : check.distance + ' km' }}
                                </template>
                              </my-slider>
                          </block>

                          <block v-if="configInfo.plugAuth.store">
                            <view class="c-title pt-lg" style="padding-top: 8rpx;padding-bottom: 8rpx;font-size: 22rpx;">服务类型
                            </view>
                            <view class="flex-warp">
                              <view @tap.stop="toChangeItem('service_type',item.id)"
                                    class="list-item flex-center mt-md mr-md f-paragraph c-paragraph radius"
                                    :style="{background:check.service_type==item.id?primaryColor:'',color:check.service_type==item.id?'#fff':''}"
                                    v-for="(item,index) in serviceTypeList" :key="index">{{item.title}}
                              </view>
                            </view>
                            <view class="c-title pt-lg" style="padding-top: 8rpx;padding-bottom: 8rpx;font-size: 22rpx;">个性筛选
                            </view>
                            <input type="text" v-model="check.store_name" placeholder="请输入店铺名称"
                                   :adjust-position="false"
                                   class="list-item text-center f-paragraph c-paragraph radius"
                                   style="width:100%" />
                            <block v-if="1==2">
                              <!-- #ifdef H5 -->
                              <input @focus="maxHeight = '10vh'" @blur="maxHeight = '37vh'" type="text"
                                     v-model="check.store_name" placeholder="请输入店铺名称" :adjust-position="true"
                                     class="list-item text-center f-paragraph c-paragraph radius"
                                     style="width:100%" />
                              <!-- #endif -->
                              <!-- #ifndef H5 -->
                              <input type="text" v-model="check.store_name" placeholder="请输入店铺名称"
                                     :adjust-position="true"
                                     class="list-item text-center f-paragraph c-paragraph radius"
                                     style="width:100%" />
                              <!-- #endif -->
                            </block>
                          </block>

                          <block>
                            <view class="f-mini-title c-title pt-lg flex-between" style="padding-top: 8rpx;padding-bottom: 8rpx;font-size: 22rpx;">
                              <view class="flex-y-center">
                                <view>
                                  年龄排序
                                </view>
                                <view class="c-caption f-caption ml-md">(岁)</view>
                              </view>
                              <view class="c-caption">
                                {{ `${check.ageRange[0]} - ${check.ageRange[1]}` }}
                              </view>
                            </view>
                            <view class="flex-center" style="margin-bottom: 16rpx;">
                              <view
                                    @tap.stop="toChangeItem('ageNum',item.id, 0)"
                                    class="list-item flex-center mr-md f-paragraph c-paragraph radius"
                                    :style="{background:check.ageNum==item.id?primaryColor:'',color:check.ageNum==item.id?'#fff':''}"
                                    v-for="(item,index) in ageRange" :key="index">{{item.title}}
                              </view>
                            </view>
                            <my-slider
                                class=""
								style="margin-bottom: 35rpx;"
                                :min="ageMin"
                                :max="ageMax"
                                v-model="check.ageRange"
                                :step="1"
                                range
                                @input="onDistanceInput"
                                :activeColor="primaryColor"
                                :centerCircleColor="primaryColor"
                            >
                              <template v-slot:button="{ index }">
                                {{ check.ageRange[index] }}
                              </template>
                            </my-slider>
                          </block>
                        </block>
                      </view>
                      <view class="btn-list pd-lg flex-center f-mini-title">
                        <view class="item-btn flex-center f-desc c-base radius mr-lg"
                              :style="{background: '#888'}" @tap.stop="toReset">
                          重置
                        </view>
                        <view class="item-btn flex-center f-desc c-base radius"
                              :style="{background: primaryColor}" @tap.stop="toConfirm">
                          确定
                        </view>
                      </view>
                    </view>
                  </template>
                </DropdownItem>
              </DropdownMenu>
            </view>

						<view class="search-cate-list-2 flex-between mt-md ml-md mr-md pb-md"
                  v-if="configInfo.coach_filter_show == 2">
							<picker @change="sortChange($event)" :value="sortIndex" :range="sortList" range-key="title">
								<view class="item-child flex-center f-desc radius-16"
									:style="{background:check.recommend?primaryColor:'',color:check.recommend?'#fff':''}">
									<view class="">
										{{sortList[sortIndex].title}}
									</view>
									<view class="flex-center item-child-icon"
										:style="{background: check.recommend ? 'transparent' : '#f2f2f2'}">
										<i class="iconfont iconxiangxiazhankai"
											style="font-size: 9px;margin-top: 1px"></i>
									</view>
								</view>
							</picker>
							<view @tap.stop="toChangeItem('sex', check.sex == 0 ? -1 : 0, 1)"
								class="item-child flex-center f-desc radius-16 rel"
								:style="{border:check.sex==0?`1px solid ${primaryColor}`:'',color:check.sex==0?primaryColor:'',background:check.sex==0?'#fff':''}">
								<view class="ellipsis rel" style="z-index: 9;">男生</view>
								<view class="abs item-child-bg" :style="{background: check.sex == 0?primaryColor:''}">
								</view>
							</view>
							<view @tap.stop="toChangeItem('sex', check.sex == 1 ? -1 : 1, 1)"
								class="item-child flex-center f-desc radius-16"
								:style="{border:check.sex==1?`1px solid ${primaryColor}`:'',color:check.sex==1?primaryColor:'',background:check.sex==1?'#fff':''}">
								<view class="ellipsis" style="z-index: 9;">女生</view>
								<view class="abs item-child-bg" :style="{background: check.sex == 1?primaryColor:''}">
								</view>
							</view>
							<view @tap.stop="toPopup('search_item','open')"
								class="item-child flex-center f-desc radius-16">
								<i class="iconfont iconshaixuan" style="font-size: 12px;"></i>
								<text style="margin-left: 3px;">筛选</text>
							</view>
						</view>
					</view>
				</view>
				<view class="flex-center" style="padding:0 20rpx 20rpx 20rpx" :style="{color:primaryColor}"
					v-if="list.merchant_phone">
					<i class="iconfont iconshangjia_11" style="font-size:44rpx;margin-right: 15rpx;"></i>
					<view class="flex-1 flex-between">
						<view class="flex-y-center f-paragraph">本地商家客服电话：<view class="f-mini-title">
								{{list.merchant_phone}}
							</view>
						</view>
						<view @tap.stop="toContact" class="flex-center f-desc radius" style="width:96rpx;height:52rpx"
							:style="{background:primaryColor,color:'#fff'}">拨打</view>
					</view>
				</view>
			</view>
		</fixed>

		<view class="f-caption" style="word-break: break-all;" v-if="userInfo && userInfo.nickName == '测试用户 console'">
			{{JSON.stringify(city_info)}}----{{JSON.stringify(param)}}----{{JSON.stringify(location)}}----{{list.total}}--{{pageActive}}
		</view>

		<view class="ml-md mr-md"
			:class="[{'flex-warp': configInfo.coach_list_format == 2 || (configInfo.play_list_format == 1 && careerList[careerIndex].type == 2 && configInfo.coach_career_show == 1) || configInfo.plugAuth.industrytype == 2}]"
			v-if="list.data && list.data.length>0">
			<view
				:class="[
						{'mt-md':(configInfo.plugAuth.industrytype != 2 && [1,3,4].includes(configInfo.coach_list_format) && (careerList[careerIndex].type != 2 || !configInfo.coach_career_show) &&index!=0) || ((configInfo.coach_list_format == 2 || (configInfo.play_list_format == 1 && careerList[careerIndex].type == 2 && configInfo.coach_career_show == 1) || configInfo.plugAuth.industrytype === 2 ) && index>1)},
						{'mr-md': (configInfo.coach_list_format == 2 || (configInfo.play_list_format == 1 && careerList[careerIndex].type == 2 && configInfo.coach_career_show == 1) || configInfo.plugAuth.industrytype === 2) && index%2==0}]"
				v-for="(item,index) in list.data" :key="index">
				<longbingbing-technician-list-item @comment="toShowPopup(index,'message')"
					:type="configInfo.coach_format == 2 && configInfo.coach_career_show == 1 ? careerList[careerIndex].type : 0"
					@collect="toCollect(index)" @order="toShowPopup(index,'technician')" :info="item">
				</longbingbing-technician-list-item>
			</view>
		</view>

		<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0&&location.lng" :loading="loading">
		</load-more>
		<block v-if="!loading&&list.data.length<=0&&list.current_page==1">
			<block v-if="!location.lat&&!location.lng">
				<!-- #ifdef H5 -->
				<abnor type="NOT_LOCATION"
					:percent="`calc(${sysheight}px - 260px - calc(30rpx + env(safe-area-inset-bottom) / 2) - calc(98rpx + env(safe-area-inset-bottom) / 2))`"
					:title="`暂无人员数据`" :image="`https://api.huixuananmm.com/admin/public/no-user.png`"></abnor>
				<!-- #endif -->
				<!-- #ifndef H5 -->
				<abnor type="NOT_LOCATION"
					:percent="`calc(${sysheight}px - 260px - calc(30rpx + env(safe-area-inset-bottom) / 2) - calc(98rpx + env(safe-area-inset-bottom) / 2))`"
					:title="`暂无人员数据`" @confirm="toOpenLocation" :button="[{ text: '开启定位' , type: 'confirm' }]"
					btnSize="" :image="`https://api.huixuananmm.com/admin/public/no-user.png`"></abnor>
				<!-- #endif -->
			</block>
			<block v-else>
				<abnor :image="`https://api.huixuananmm.com/admin/public/no-user.png`"
					:percent="`calc(${sysheight}px - 260px - calc(30rpx + env(safe-area-inset-bottom) / 2) - calc(98rpx + env(safe-area-inset-bottom) / 2))`"
					:tip="[{ text:  `暂无${check.recommend && check.free_fare ?`${recommend_text}的免出行费`: check.recommend ?recommend_text: check.free_fare ? '免出行费':''}人员数据`, color: 0 }]">
				</abnor v-if="param.city_id">
			</block>
		</block>

		<view class="fill-base fix" :style="{top:`${popupHeight}px`,bottom:`${configInfo.tabbarHeight}px`}"
			v-if="!loading&&list.data.length<=0&&list.current_page==1&&(!city_info || (city_info&&!city_info.id&&!city_info.title))&&cityList.length>0&&location.lat&&location.lng">
			<longbingbing-open-city-item ref="open_city_item" :height="popupHeight"></longbingbing-open-city-item>
		</view>

		<view class="space-lg"></view>

		<longbingbing-technician-list-popup ref="technician_list_popup"></longbingbing-technician-list-popup>

		<uni-popup ref="choose_city_item" type="top" :custom="true" :zIndex="999">
			<view :style="{height:configInfo.navBarHeight + 8 + 'px'}"></view>
			<view class="choose-city-popup rel">
				<image class="city-img" :src="`https://api.huixuananmm.com/admin/anmo/technician/no_city.png`"></image>
				<view class="text f-paragraph c-base abs">
					很抱歉,该城市未开通, 点击左上角切换其他城市下单服务
				</view>
				<view class="flex-between">
					<view></view>
					<view @tap.stop="$refs.choose_city_item.close()"
						class="item-btn flex-center f-paragraph c-title text-bold radius">知道了</view>
				</view>
			</view>
		</uni-popup>

		<uni-popup @change="toChangePopupShow" ref="search_item" type="top" left="164rpx" :custom="true" :zIndex="999">
			<view class="search-popup">
				<!-- #ifdef H5 -->
				<view :style="{height:configInfo.navBarHeight + 'px'}"></view>
				<view class="fill-base pd-lg" :style="{height:`calc(100% - ${configInfo.navBarHeight}px)`}">
				<!-- #endif -->
					<!-- #ifndef H5 -->
					<view :style="{height:configInfo.navBarHeight + 'px'}"></view>
					<view class="fill-base pd-lg" :style="{height:`calc(100% - ${configInfo.navBarHeight}px)`}">
					<!-- #endif -->
						<block v-if="isCareer">
							<view class="flex-warp">
								<view @tap.stop="toChangeCareer(index)"
									class="list-item flex-center mt-md mr-md f-paragraph c-paragraph radius pl-sm pr-sm"
									:style="{background:checkCareerIndex==index?primaryColor:'',color:checkCareerIndex==index?'#fff':''}"
									v-for="(item,index) in careerList" :key="index">{{item.title}}
								</view>
							</view>
						</block>
						<block v-else>
							<block v-if="configInfo.coach_filter_show !== 2">
								<view class="f-desc c-title text-bold">{{$t('action.attendantName')}}性别
								</view>
								<view class="flex-warp">
									<view @tap.stop="toChangeItem('sex',item.id)"
										class="list-item flex-center mt-md mr-md f-paragraph c-paragraph radius"
										:style="{background:check.sex==item.id?primaryColor:'',color:check.sex==item.id?'#fff':''}"
										v-for="(item,index) in sexList" :key="index">{{item.title}}
									</view>
								</view>
							</block>
							<block v-if="serviceCateList && serviceCateList.length>0">
								<view class="f-desc c-title text-bold pt-lg mt-md">
									服务分类
								</view>
								<view class="service-cate-scroll">
									<scroll-view scroll-y>
										<view class="flex-warp">
											<view @tap.stop="toChangeItem('cate_id',item.id)"
												class="list-item flex-center mt-md mr-md f-paragraph c-paragraph radius"
												:style="{background:check.cate_id==item.id?primaryColor:'',color:check.cate_id==item.id?'#fff':''}"
												v-for="(item,index) in serviceCateList" :key="index">{{item.title}}
											</view>
										</view>
									</scroll-view>
								</view>
							</block>
							<block v-if="configInfo.plugAuth.store">
								<view class="f-desc c-title text-bold pt-lg mt-md">服务类型
								</view>
								<view class="flex-warp">
									<view @tap.stop="toChangeItem('service_type',item.id)"
										class="list-item flex-center mt-md mr-md f-paragraph c-paragraph radius"
										:style="{background:check.service_type==item.id?primaryColor:'',color:check.service_type==item.id?'#fff':''}"
										v-for="(item,index) in serviceTypeList" :key="index">{{item.title}}
									</view>
								</view>
								<view class="f-desc c-title text-bold pt-lg mt-md">个性筛选
								</view>
								<input type="text" v-model="check.store_name" placeholder="请输入店铺名称"
									:adjust-position="false"
									class="list-item text-center mt-md f-paragraph c-paragraph radius"
									style="width:100%" />
								<block v-if="1==2">
									<!-- #ifdef H5 -->
									<input @focus="maxHeight = '10vh'" @blur="maxHeight = '37vh'" type="text"
										v-model="check.store_name" placeholder="请输入店铺名称" :adjust-position="true"
										class="list-item text-center mt-md f-paragraph c-paragraph radius"
										style="width:100%" />
									<!-- #endif -->
									<!-- #ifndef H5 -->
									<input type="text" v-model="check.store_name" placeholder="请输入店铺名称"
										:adjust-position="true"
										class="list-item text-center mt-md f-paragraph c-paragraph radius"
										style="width:100%" />
									<!-- #endif -->
								</block>
							</block>
						</block>
						<view style="height:60rpx"></view>
						<view class="flex-center">
							<view @tap.stop="toReset" class="search-btn flex-center f-mini-title c-title radius">重置
							</view>
							<view @tap.stop="toConfirm" class="search-btn flex-center ml-lg f-mini-title c-base radius"
								:style="{background:primaryColor,borderColor:primaryColor}">确定</view>
						</view>
					</view>
				</view>
		</uni-popup>

		<view :style="{height: `${configInfo.tabbarHeight}px`}"></view>
		<longbingbing-tabbar :cur="2"></longbingbing-tabbar>

		<!-- #ifdef APP-PLUS -->
		<longbingbing-open-location-info ref="open_location_info"></longbingbing-open-location-info>
		<longbingbing-login-info></longbingbing-login-info>
		<longbingbing-app-check-auth :type="appType" ref="app_check_item"
			@confirm="toConfirmAppCheckAuth"></longbingbing-app-check-auth>
		<!-- #endif -->
		<longbingbing-change-user-type></longbingbing-change-user-type>

		<!-- #ifdef MP-WEIXIN -->
		<user-privacy ref="user_privacy" :show="false"></user-privacy>
		<!-- #endif -->
	</view>
</template>

<script>
	import {
		mapState,
		mapActions,
		mapMutations
	} from "vuex"
	import siteInfo from '@/siteinfo.js';
	import longbingbingTechnicianListItem from "@/components/longbingbing-technician-list-item.vue"
	import longbingbingTechnicianListPopup from "@/components/longbingbing-technician-list-popup.vue"
	import longbingbingOpenCityItem from "@/components/longbingbing-open-city-item.vue"
  import DropdownMenu from "@/components/DropdownMenu.vue";
  import DropdownItem from "@/components/DropdownItem.vue";
  import MySlider from "@/components/MySlider.vue";
	export default {
		components: {
			longbingbingTechnicianListItem,
			longbingbingTechnicianListPopup,
			longbingbingOpenCityItem,
      DropdownMenu,
      DropdownItem,
      MySlider
		},
		data() {
			return {
        value2: "",
				isLoad: false,
				options: {},
				navTitle: '',
				popupHeight: '',
				fixHeight: 0,
				maxHeight: '37vh',
				loading: true,
				lockTap: false,
				appType: 'location',
				appMethod: '',
				isCareer: false,
        sortValue: 'all',
        filterValue: 'all',
        timeActiveIndex: 0,
        tabTimeList: [],
        serviceTypeList: [],
        serviceTypeInd: 0,
        send_info: {},
        timeList: [],
        ageMin: 18,
        ageMax: 55,
        intelligentSortValue: '',
        serviceValue: "",
				allSortData: false,
				isSearch: false
			}
		},
		computed: mapState({
			pageActive: state => state.technician.pageActive,
			haveOperItem: state => state.technician.haveOperItem,
			cityList: state => state.technician.cityList,
			activeIndex: state => state.technician.activeIndex,
			tabList: state => state.technician.tabList,
      serviceFilterList: state => state.technician.serviceFilterList,
			sexList: state => state.technician.sexList,
      ageRange: state => state.technician.ageRange,
			serviceCateList: state => state.technician.serviceCateList,
			serviceTypeList: state => state.technician.serviceTypeList,
			check: state => state.technician.check,
			param: state => state.technician.param,
			list: state => state.technician.list,
			configInfo: state => state.config.configInfo,
			sysheight: state => state.config.sysheight,
			loginType: state => state.user.loginType,
			isGzhLogin: state => state.user.isGzhLogin,
			haveShieldOper: state => state.user.haveShieldOper,
			sortList: state => state.technician.sortList,
			sortIndex: state => state.technician.sortIndex,
			careerIndex: state => state.technician.careerIndex,
			careerList: state => state.technician.careerList,
			checkCareerIndex: state => state.technician.checkCareerIndex
		}),
		async onLoad(options) {
			let launch = 0
			// #ifdef MP-WEIXIN
			let {
				scene
			} = await uni.getLaunchOptionsSync()
			launch = scene // 1154：朋友圈
			options.launch = launch
			// #endif
			options = await this.updateCommonOptions(options)
			let {
				pid = 0,
			} = options
			options.pid = pid * 1
			this.options = options

			// #ifdef MP-WEIXIN
			uni.showShareMenu({
				menus: ['shareAppMessage', 'shareTimeline']
			})
			// #endif

			let {
				data = []
			} = this.list
			let city_refresh = data.length == 0 || !this.param.city_id
			let {
				realtime_location = 0,
			} = this.configInfo
			let {
				pageActive,
				changeAddr
			} = this
			await this.$util.toAsyAccLogin()
			if (pageActive && !realtime_location && !changeAddr && !pid && !city_refresh) {
				this.isLoad = true
				this.loading = false
				this.$util.hideAll()
				this.initNavTitle()
				return
			}
			await this.initIndex()
			this.initNavTitle()
		},
		async onShow() {
			this.initNavTitle(this.appShare ? 0 : 1)

			if (!this.location.lat && this.locaRefuse) {
				this.toResetUtilLoca()
			}

			let {
				status: coach_status = 0,
				coach_position = 0
			} = this.userCoachStatus
			let {
				realtime_location = 0
			} = this.configInfo

			if (this.haveShieldOper == 2 || this.haveOperItem) {
				this.initIndex()
				this.updateUserItem({
					key: 'haveShieldOper',
					val: 0
				})
				this.updateTechnicianItem({
					key: 'haveOperItem',
					val: false
				})
			} else if (this.pageActive && !realtime_location && coach_position && coach_status == 2) {
				this.$util.getCoachUtilLoca()
			}

		},
		onPullDownRefresh() {
			// #ifndef APP-PLUS
			uni.showNavigationBarLoading()
			// #endif
			if (this.configInfo.realtime_location) {
				this.updateUserItem({
					key: 'changeAddr',
					val: false
				})
			}
			this.initRefresh()
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			if (this.list.current_page >= this.list.last_page || this.loading) return;
			this.loading = true;
			this.getList(this.param.page + 1);
		},
		onShareTimeline() {
			let {
				navTitle: title
			} = this
			if (title.split('列表').length == 1) {
				title += `列表`
			}
			let {
				app_logo
			} = this.configInfo
			let imageUrl = app_logo || ''
			let {
				id: pid = 0
			} = this.userInfo
			let query = `pid=${pid}`
			return {
				title,
				imageUrl,
				query
			}
		},
		onShareAppMessage(e) {
			let {
				navTitle: title
			} = this
			if (title.split('列表').length == 1) {
				title += `列表`
			}
			let {
				id: pid = 0
			} = this.userInfo
			let path = `/pages/technician?pid=${pid}`
			this.$util.log(path)
			return {
				title,
				imageUrl: '',
				path,
			}
		},
		watch: {
			'list.merchant_phone'(newval, oldval) {
				this.fixHeight = new Date().getTime()
			},
			configInfo(newval, oldval) {
				this.fixHeight = new Date().getTime()
			},
			locaRefuse(newval, oldval) {
				if (!newval) {
					this.toResetUtilLoca()
				}
			}
			// #ifndef H5
			,
			changeOnAddr(newval, oldval) {
				let {
					noloca,
					refresh
				} = this.noChangeLoca
				if (newval && noloca) {
					this.initUtilLocaData()
				}
			},
			noChangeLoca(newval, oldval) {
				setTimeout(() => {
					let {
						lat,
						lng,
						unix = 0
					} = this.changeOnAddr
					let {
						noloca,
						refresh
					} = this.noChangeLoca
					let cur_unix = this.$util.DateToUnix(this.$util.formatTime(new Date(), 'YY-M-D h:m:s'))
					if (noloca && ((!lat && !lng) || !unix || (unix && (cur_unix - unix >= 1)))) {
						this.getUtilLocation()
					}
				}, 800)
			}
			// #endif
		},
		methods: {
			...mapActions(['getConfigInfo', 'getUserInfo', 'getServiceCate', 'getCityList', 'getServiceCoachList',
				'addScanRecord', 'updateScanRecord', 'updateCommonOptions', 'getIndustryType'
			]),
			...mapMutations(['updateUserItem', 'updateServiceItem', 'updateTechnicianItem', 'updateMapItem',
				'updateDynamicItem', 'updateShopstoreItem'
			]),
		handleSearch(){
		this.isSearch = !this.isSearch
},
      onDistanceInput(value, activeIndex) {
        console.log("拖动中：", value, activeIndex);
      },
      intelligentSortChange(e) {
        this.intelligentSortValue = e.id
        let ind = e.id
        this.updateTechnicianItem({
          key: 'sortIndex',
          val: ind
        })
        this.getList(1)
      },
      onTitleClick() {
        console.log('this.timeActiveIndex', this.timeActiveIndex)
        this.getStoreDay()
      },
      async restBtn() {
        this.timeActiveIndex = 0
        this.send_info = {}
        this.updateTechnicianItem({
          key: 'check',
          val: {
            ...this.check,
            serviceTimeRange: ''
          }
        })
        await this.getList(1)
        this.$refs.myDropdown.close();
      },
      async sureBtn() {
        let check = this.$util.deepCopy(this.check)
        check.serviceTimeRange = this.send_info.time
        this.updateTechnicianItem({
          key: 'check',
          val: check
        })
        await this.getList(1)
        this.$refs.myDropdown.close();
      },
      handerTimeTabChange(index) {
        console.log('----------.', index)
        this.timeActiveIndex = index
        this.getStoreTime()
      },
      async getStoreDay() {
        let data = await this.$api.usernew.getServiceDate()
        // let data = [
        //   {
        //     "dat_str": 1755100800,
        //     "dat_text": "08-14",
        //     "week": "周四"
        //   },
        //   {
        //     "dat_str": 1755187200,
        //     "dat_text": "08-15",
        //     "week": "周五"
        //   },
        //   {
        //     "dat_str": 1755273600,
        //     "dat_text": "08-16",
        //     "week": "周六"
        //   }
        // ]
        data.map((item, index) => {
          item.title = `${index==0?'今日':index==1?'明日':item.week} ${item.dat_text}`
        })
        this.tabTimeList = data
        let {
          time_str = ''
        } = this.send_info
        let dat_text = this.$util.formatTime(time_str * 1000, 'M-D')
        if (this.timeActiveIndex == 0) {
          this.timeActiveIndex = this.tabTimeList.findIndex(item => {
            return item.dat_text == dat_text
          })
        }
        await this.getStoreTime()
        this.$util.hideAll()
      },
      async getStoreTime() {
        let {
          activeIndex
        } = this
        if (activeIndex < 0) return
        let { dat_str: day } = this.tabTimeList[activeIndex]
/*        this.timeList = await this.$api.usernew.getServiceDateTime({
          day
        });  */
        this.timeList = [
          {
            "time_str": 1755156600,
            "time_text": "15:30",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 0
          },
          {
            "time_str": 1755158400,
            "time_text": "16:00",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755160200,
            "time_text": "16:30",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755162000,
            "time_text": "17:00",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755163800,
            "time_text": "17:30",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755165600,
            "time_text": "18:00",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755167400,
            "time_text": "18:30",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755169200,
            "time_text": "19:00",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755171000,
            "time_text": "19:30",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755172800,
            "time_text": "20:00",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755174600,
            "time_text": "20:30",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755176400,
            "time_text": "21:00",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755178200,
            "time_text": "21:30",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755180000,
            "time_text": "22:00",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755181800,
            "time_text": "22:30",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755183600,
            "time_text": "23:00",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          },
          {
            "time_str": 1755185400,
            "time_text": "23:30",
            "time_texts": "2025-08-14",
            "is_click": 0,
            "is_order": 0,
            "status": 1
          }
        ]
        this.$util.hideAll()
      },
      toChooseTime(index) {
        let {
          tabTimeList,
          timeActiveIndex
        } = this
        let item = this.timeList[index]
        if (item.status != 1) return
        item.time =
            `${timeActiveIndex==0?'今日':timeActiveIndex==1?'明日':tabTimeList[timeActiveIndex].week} ${tabTimeList[timeActiveIndex].dat_text} ${item.time_text}`
        this.send_info = item
        console.log('send_info', this.send_info)
      },
			async initIndex(refresh = false) {
				let {
					pid = 0,
						launch = 0
				} = this.options
				let code = this.scanRecordId
				// #ifdef H5
				code = this.$util.getQueryString('code')
				// #endif
				if (pid && !code) {
					this.addScanRecord({
						type: 2,
						qr_id: pid,
						is_qr: 0
					})
				}
				let {
					id: uid = 0
				} = this.userInfo
				if (launch != 1154 && pid && !code && !uid) {
					await this.getUserInfo()
				}

				if (!this.configInfo.id || refresh) {
					await this.getConfigInfo()
				}
				await Promise.all([this.getIndustryType(), this.getServiceCate()])
				this.updateTechnicianItem({
					key: 'pageActive',
					val: true
				})
				this.isNotLoca()
			},
			async initRefresh() {
				this.fixHeight = new Date().getTime()
				this.param.page = 1
				await this.initIndex(true)
			},
			async initNavTitle(isShow = 0) {
				let {
					tabBar
				} = this.configInfo
				if (tabBar && tabBar.length > 0) {
					let ind = tabBar.findIndex(item => {
						return item.id == 2
					})
					let navTitle = tabBar[ind].name
					this.navTitle = navTitle
					// #ifdef H5
					uni.setNavigationBarTitle({
						title: navTitle
					})
					// #endif
					if (this.scanRecordId) {
						this.updateScanRecord()
					}
					if (!isShow) {
						// #ifdef H5
						this.$jweixin.initJssdk(() => {
							this.toAppShare()
						})
						this.updateUserItem({
							key: 'appShare',
							val: false
						})
						// #endif
					}
				}
			},
			async toResetUtilLoca() {
				// #ifdef APP-PLUS
				let {
					lat: locaLat = 0
				} = this.location
				let {
					appCheckLocaStatus = null
				} = this
				if (!locaLat && appCheckLocaStatus == 1 && this.pageActive) {
					let {
						lng = 0,
							lat = 0
					} = await this.$util.getUtilLocation()
					if (!lat && !lng) return
					await this.getList(1, true)
					let updateArr = ['updateServiceItem', 'updateMapItem',
						'updateDynamicItem', 'updateShopstoreItem'
					]
					updateArr.map(item => {
						this[item]({
							key: 'pageActive',
							val: false
						})
					})
				}
				// #endif
			},
			toConfirmAppCheckAuth() {
				let {
					appMethod
				} = this
				this[appMethod]()
			},
			async toOpenLocation() {
				// #ifdef APP-PLUS
				if (plus.os.name == 'Android' && plus.navigator.checkPermission(
						'android.permission.ACCESS_FINE_LOCATION') ===
					'undetermined') {
					this.appType = 'location'
					this.appMethod = 'toConfirmOpenLoca'
					this.$refs.app_check_item.open()
				} else {
					this.toConfirmOpenLoca()
				}
				// #endif
				// #ifndef APP-PLUS
				this.toConfirmOpenLoca()
				// #endif
			},
			async toConfirmOpenLoca() {
				// #ifdef MP-WEIXIN
				let privacyCheck = this.$refs.user_privacy.check()
				if (privacyCheck) {
					this.$refs.user_privacy.open()
					return
				}
				// #endif
				this.initIndex()
			},
			toContact() {
				let {
					merchant_phone: url = ''
				} = this.list
				// #ifdef APP-PLUS
				if (plus.os.name == 'Android' && plus.navigator.checkPermission(
						'android.permission.CALL_PHONE') ===
					'undetermined') {
					this.appType = 'phone'
					this.appMethod = 'toConfirmContact'
					this.$refs.app_check_item.open()
				} else {
					this.$util.goUrl({
						url,
						openType: 'call'
					})
				}
				// #endif
				// #ifndef APP-PLUS
				this.$util.goUrl({
					url,
					openType: 'call'
				})
				// #endif
			},
			toConfirmContact() {
				let {
					merchant_phone: url = ''
				} = this.list
				this.$util.goUrl({
					url,
					openType: 'call'
				})
			},
			toAppShare() {
				let {
					id: pid = 0
				} = this.userInfo
				let {
					navTitle: title
				} = this
				if (title.split('列表').length == 1) {
					title += `列表`
				}
				let {
					siteroot
				} = siteInfo
				let url = siteroot.split('/index.php')[0]
				let href = `${url}/${this.portName}/#/pages/technician?pid=${pid}`
				let {
					app_logo
				} = this.configInfo
				let imageUrl = app_logo || ''
				this.$jweixin.showOptionMenu()
				this.$jweixin.shareAppMessage(title, '', href, imageUrl)
				this.$jweixin.shareTimelineMessage(title, href, imageUrl)
			},
			initFixHeight(val) {
				this.popupHeight = val
			},
			sortChange(e) {
				let ind = e.target.value
				this.updateTechnicianItem({
					key: 'sortIndex',
					val: ind
				})
				this.getList(1)
			},
			toSearch(val) {
				let param = this.$util.deepCopy(this.param)
				param.coach_name = val
				this.updateTechnicianItem({
					key: 'param',
					val: param
				})
				this.getList(1)
			},
			// 选择地址
			async toChooseLocation(init_city = 0) {
				this.updateUserItem({
					key: 'changeAddr',
					val: true
				})
				if (this.$refs.open_city_item) {
					this.$refs.open_city_item.city = ''
				}
				await this.getList(1, init_city == 1)
			},
			async isNotLoca() {
				let {
					location,
					locaRefuse,
					changeAddr
				} = this
				let {
					realtime_location = 0
				} = this.configInfo

				let {
					status: coach_status = 0,
					coach_position = 0
				} = this.userCoachStatus

				// #ifdef H5
				if (coach_position && coach_status == 2 && (location.lat && location.address != '暂未获取到位置信息' && !
						realtime_location)) {
					this.updateUserItem({
						key: 'isChangeCoachLoca',
						val: true
					})
				}
				// #endif

				// #ifdef APP-PLUS
				if (!locaRefuse && (!location.lat || (location.lat &&
						location.address == '暂未获取到位置信息') || (
						realtime_location && !changeAddr))) {
					// #endif
					// #ifndef APP-PLUS
					if (!location.lat || (location.lat && location
							.address == '暂未获取到位置信息') || (
							realtime_location && !changeAddr)) {
						// #endif

						// #ifdef MP-WEIXIN
						let privacyCheck = this.$refs.user_privacy.check()
						if (privacyCheck || typeof(privacyCheck) == 'string') {
							if (privacyCheck) {
								this.$refs.user_privacy.open()
							}
							if (typeof(privacyCheck) == 'string') {
								await this.getList(1, this.param.city_id && this.changeAddr ? false : true)
							}
							this.loading = false
							this.$util.hideAll()
							this.isLoad = true
							return
						}
						// #endif

						// #ifndef H5
						if (coach_position && coach_status == 2) {
							let {
								lat: change_lat = 0,
								lng: change_lng = 0,
								unix = 0
							} = this.changeOnAddr
							let cur_unix = this.$util.DateToUnix(this.$util
								.formatTime(new Date(), 'YY-M-D h:m:s')
							)
							let noloca = change_lat && change_lng && (
									unix && (cur_unix - unix < 3)) ?
								false : true
							if (!noloca) {
								let loca = Object.assign({}, this
									.location, {
										lat: change_lat,
										lng: change_lng,
										is_util_loca: 1
									})
								this.updateUserItem({
									key: 'location',
									val: loca
								})
							}
							this.updateUserItem({
								key: 'noChangeLoca',
								val: {
									noloca
								}
							})
							if (this.noChangeLoca.noloca) return
							this.initUtilLocaData()
						} else {
							this.getUtilLocation()
						}
						return
						// #endif
						// #ifdef H5
						await this.$util.getUtilLocation()
						// #endif
					}
					this.initUtilLocaData()
				},
				async getUtilLocation() {
						await this.$util.getUtilLocation()
						this.initUtilLocaData()
					},
					async initUtilLocaData() {
							// #ifndef H5
							this.updateUserItem({
								key: 'noChangeLoca',
								val: {
									noloca: false
								}
							})
							// #endif
							let {
								city_id: cid = 0
							} = this.param
							let {
								id: city_info_id = 0
							} = this.city_info

							let param = this.$util.deepCopy(this.param)
							param.city_id = cid || city_info_id
							this.updateTechnicianItem({
								key: 'param',
								val: param
							})
							await this.getList(1, this.param.city_id && this.changeAddr ? false : true)
							let {
								lat = 0, lng = 0, is_util_loca = 0, isIp = true
							} = this.location
							let {
								realtime_location = 0
							} = this.configInfo
							let {
								changeAddr,
							} = this
							let {
								city_id = 0
							} = this.param
							if (lat && lng && city_id && (is_util_loca || (realtime_location && !
									changeAddr))) {
								this.$util.getMapInfo(isIp, true, {}, changeAddr)
							}
						},
						handerTabChange(index, type) {
							this.updateTechnicianItem({
								key: [type],
								val: index
							})
							if (type == 'careerIndex') {
								this.updateTechnicianItem({
									key: 'checkCareerIndex',
									val: index
								})
							}
							uni.pageScrollTo({
								scrollTop: 0
							})
							this.list.data = []
							this.getList(1)
						},
						async getList(page = 0, refresh = false) {
								if (page) {
									let param = this.$util.deepCopy(this.param)
									param.page = page
									this.updateTechnicianItem({
										key: 'param',
										val: param
									})
								}
								this.loading = true

								let {
									lat = 0, lng = 0, is_util_loca = 0, isIp = true
								} = this.location
								if (refresh || this.cityList.length == 0) {
									await this.getCityList({
										lat,
										lng,
										change: refresh ? 1 : this.param.city_id ? 0 : 1
									})
								}
								let {
									realtime_location = 0
								} = this.configInfo
								let {
									changeAddr
								} = this

								// #ifdef APP-PLUS
								if (!lat && !lng) {
									this.isLoad = true
									this.loading = false
									this.$util.hideAll()
									this.updateTechnicianItem({
										key: 'list',
										val: {
											data: [],
											last_page: 1,
											current_page: 1
										}
									})
									return
								}
								// #endif

								let {
									list: oldList,
									activeIndex,
									tabList,
									cityList,
									careerIndex,
									careerList,
									sortList,
									sortIndex
								} = this
								let param = this.$util.deepCopy(this.param)

								let cityIndex = cityList.findIndex(item => {
									return item.id == param.city_id
								})
								console.log(cityIndex, "===cityIndex")
								if (cityIndex == -1) {
									if (lat && lng && (is_util_loca || (realtime_location && !changeAddr))) {
										this.$util.getMapInfo(isIp, true, {}, changeAddr, true)
									}
									// this.$refs.choose_city_item.open()
									if (this.$refs.open_city_item) {
										this.$refs.open_city_item.initIndex()
									}
									this.loading = false
									this.$util.hideAll()
									this.updateTechnicianItem({
										key: 'list',
										val: {
											data: [],
											last_page: 1,
											current_page: 1,
											no_city: 1
										}
									})
									return
								}


								let {
									coach_format = 1,
										coach_filter_show = 0,
										coach_career_show = 0,
										plugAuth
								} = this.configInfo
								param = Object.assign({}, param, this.check, {
									lat,
									lng
								})
								if (coach_format == 1) {
									param.type = tabList[activeIndex].id
								}
								if (coach_format == 2 && coach_career_show == 1) {
									param.industry_type = careerList[careerIndex].id
								}
								if (coach_filter_show == 2) {
									param.sort = sortList[sortIndex].id
								}

								if (!coach_filter_show) {
									delete param.sex
									delete param.cate_id
									delete param.service_type
									delete param.store_name
									if (coach_format === 2) {
										delete param.recommend
										delete param.free_fare
									}
								} else {
									if (param.sex === -1) {
										delete param.sex
									}
									if (param.recommend === 0) {
										delete param.recommend
									}
									if (param.cate_id === 0) {
										delete param.cate_id
									}
									if (param.service_type === 0) {
										delete param.service_type
									}
								}
								await this.getServiceCoachList(param)
								this.loading = false
								this.$util.hideAll()
							},
							toChangeCareer(index) {
								this.updateTechnicianItem({
									key: 'checkCareerIndex',
									val: index
								})
							},
							toChangeItem(key, id, flag = 0) {
								if (key == 'type') {
									this.updateTechnicianItem({
										key: 'param',
										val: Object.assign({}, this
											.param, {
												type: id
											})
									})
									if (flag == 2) {
										this.updateTechnicianItem({
											key: 'check',
											val: Object.assign({}, this
												.check, {
													recommend: 0,
													free_fare: 0
												})
										})
									}
								} else {
									if (key === 'cate_id' && this.check[key] ==
										id) {
										id = 0
									}
									let checkVal = Object.assign({}, this.check, {
										[key]: id
									})
									if (flag == 2) {
										this.updateTechnicianItem({
											key: 'param',
											val: Object.assign({}, this
												.param, {
													type: 0
												})
										})
										if (key === 'recommend') {
											checkVal.free_fare = 0
										}
										if (key === 'free_fare') {
											checkVal.recommend = 0
										}
									}
									this.updateTechnicianItem({
										key: 'check',
										val: checkVal
									})
								}
								if (!flag) return
                if (this.$refs.myDropdown) {
                  this.$refs.myDropdown.close();
                }
								this.toConfirm(0)
							},
							toPopup(refs_key, method, show = 0) {
								this.isCareer = show
								this.$refs[refs_key][method]()
								this.popupTap = method === 'open' ? true : false
							},
							toChangePopupShow(e) {
								let {
									show
								} = e
								if (show) return
								this.updateTechnicianItem({
									key: 'check',
									val: this.$util.pick(this.param, [
										'sex', 'cate_id',
										'recommend',
										'service_type',
										'store_name',
										'free_fare'
									])
								})
							},
							toReset() {
								if (this.isCareer) {
									this.updateTechnicianItem({
										key: 'checkCareerIndex',
										val: 0
									})
									this.updateTechnicianItem({
										key: 'careerIndex',
										val: 0
									})
								} else {
									let sex = -1
									if (this.configInfo.coach_filter_show == 2) {
										let check = this.$util.deepCopy(this.check)
										sex = check.sex
									}
									this.updateTechnicianItem({
										key: 'check',
										val: {
											sex,
											cate_id: 0,
											recommend: 0,
											free_fare: 0,
											service_type: 0,
											store_name: '',
                      ageRange: [18, 55],
                      distance: 10
										}
									})
								}
								this.toConfirm()
							},
							toConfirm(flag = 1) {
								if (this.isCareer) {
									this.updateTechnicianItem({
										key: 'careerIndex',
										val: this.checkCareerIndex
									})
								}
								let param = Object.assign({}, this.param, this
									.check)
								this.updateTechnicianItem({
									key: 'param',
									val: param
								})
								uni.pageScrollTo({
									scrollTop: 0
								})
								this.getList(1)
								if (!flag) return
								// #ifdef H5
								this.maxHeight = '37vh'
								// #endif
								// this.$refs.search_item.close()
                this.allSortData = !this.allSortData;
                this.$refs.myDropdown.close();
							},
							async toShowPopup(index, key) {
									this.$refs.technician_list_popup.toShowPopup(
										this.list.data[index], key)
								},
								async toCollect(index) {
									let {
										id,
										is_collect,
										collect_num
									} = this.list.data[index]
									let methodModel = is_collect ?
										'delCollect' : 'addCollect'
									await this.$api.mine[methodModel]({
										coach_id: id
									})
									this.$util.showToast({
										title: is_collect ? '取消成功' : '收藏成功'
									})
									this.list.data[index].is_collect =
										is_collect == 1 ? 0 : 1
									this.list.data[index].collect_num =
										is_collect == 1 ? collect_num - 1 :
										collect_num + 1
								}
			},
			filters: {
				handleAddrText(val) {
					let text = `定位中...`
					if (val && val.lat) {
						let {
							address = '',
								address_info = ''
						} = val
						if (address || address_info) {
							if (!address_info) {
								let arr = address.split(' ')
								address_info = arr[arr.length - 1]
							}
							text = address_info
						}
					}
					return text
				},
				handleCityText(val) {
					let text = `未知城市`
					if (val && val.title) {
						text = val.title
					}
					return text
				}
			}
		}
</script>


<style lang="scss">
	.map-list-item.fff {
		.list-btn {
			border: 1rpx solid #fff;
		}
	}
  .arrow {
    margin-left: 12rpx;
    transform: rotate(90deg);
    transition: transform .22s;
  }
  .search-cate-list-tab {
    height: 54rpx;
    font-weight: 400;
    font-size: 28rpx;
    color: #8A8A8A;
    margin-left: 26rpx;
  }
  .activeTab {
    height: 54rpx;
    font-weight: 600;
    font-size: 28rpx;
    color: #3D3D3D;
    position: relative;
    .line {
      position: absolute;
      bottom: 0;
      width: 56rpx;
      height: 4rpx;
      background: #58C06E;
      border-radius: 20rpx 20rpx 20rpx 20rpx;
    }
  }

  .technicianTab {
    margin-left: 26rpx;
    ::v-deep .dropdown-menu {
      background-color: transparent !important;
    }
    ::v-deep .dropdown-menu__bar {
      background-color: transparent !important;
      border-bottom: none !important;
    }
    ::v-deep .dropdown-item {
      background: #FFFFFF;
      border-radius: 8rpx 8rpx 8rpx 8rpx;
      margin-right: 14rpx;
      flex: none !important;
       .dropdown-item__title {
         background: transparent !important;
         font-size: 24rpx !important;
         height: 48rpx !important;
         width: 186rpx !important;
         padding: 0 !important;
         color: #333333;
      }
    }
  }

	.cate-filter-list {
		.filter-item {
			width: 25%;
			height: 90rpx;

			.cate-img {
				width: 170rpx;
				height: 78rpx;
				top: 0;
				z-index: 0;
			}

			.cate-text {
				top: 8rpx;
				height: 42rpx;
				color: #ABADAC;
			}
		}
	}

	.search-popup {
		width: calc(100% - 164rpx);
		height: 100vh;

		.service-cate-scroll {
			width: 100%;
			/* #ifdef H5 */
			max-height: 35%;
			/* #endif */
			/* #ifndef H5 */
			max-height: 40%;
			/* #endif */
			overflow: auto;
		}

		.list-item {
			min-width: 160rpx;
			height: 70rpx;
			background: #F5F5F5;

			.icon-guanbi-fill.abs {
				top: -15rpx;
				right: 0;
				font-size: 50rpx;
			}
		}

		.list-item:nth-child(3n) {
			margin-right: 0;
		}

		.search-btn {
			width: 230rpx;
			height: 80rpx;
			border: 1rpx solid #C7C7C7;
			transform: rotateZ(360deg);
		}
	}

  .popup-time {
    .service-dropdown {
      ::v-deep .tab-list {
        .uni-scroll-view-content {
          display: flex;
          justify-content: center;
        }
      }
    }
    .time-list {
      //width: calc(100% - 20rpx);
    //   height: 520rpx;
      padding: 0 10rpx;

      ::v-deep .uni-scroll-view-content {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
      }

      .time-item {
        width: 156rpx;
        height: 50rpx;
        color: #C7C7C7;
        background: #E5E5E5;
        border-radius: 16rpx;
        border: 1px solid #E5E5E5;
        margin: 5rpx;
      }

      .can-choose {
        color: #5A677E;
        background: #FFFFFF;
      }

      .cur-check {
        color: #fff;
      }
    }
  }

  .all-filter {
    font-size: 28rpx !important;
    .all-filter-cont {
      padding: 0 32rpx;
    }

    .service-cate-scroll {
      width: 100%;
      /* #ifdef H5 */
      max-height: 35%;
      /* #endif */
      /* #ifndef H5 */
      max-height: 40%;
      /* #endif */
      overflow: auto;
    }

    .list-item {
      min-width: 120rpx;
    //   height: 60rpx;
      background: #F5F5F5;
font-size: 22rpx;
      .icon-guanbi-fill.abs {
        top: -15rpx;
        right: 0;
        font-size: 50rpx;
      }
    }

    .list-item:nth-child(3n) {
      margin-right: 0;
    }
  }

  .btn-list {
	padding: 20rpx;

    &:first-child {
      border: 2rpx solid #dcdee0;
    }

    .item-btn {
      width: 100%;
      height: 60rpx;
    }
  }
</style>
